import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
// import fire_component_msg from '@feidao/web/atom/browser/msg/fire';
import error from '@feidao/web/atom/browser/msgbox/error';
export default async function (fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	//选择文件 change 验证文件类型
	const input = args[0].currentTarget as HTMLInputElement;

	const file = input.files[0];
	if (!file) {
		const input = document.querySelector<HTMLInputElement>('[data-feidao-id="import_excel"]');
		input.value = '';
		return;
	}
	if (!/xlsx|xls|sheet/.test(file.name)) {
		error('请选择excel文件！');
		return;
	}
}
